.class public Lcom/opongo/blogapp/manager/ImageManager;
.super Ljava/lang/Object;
.source "ImageManager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/opongo/blogapp/manager/ImageManager$BitmapDisplayer;,
        Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;,
        Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;,
        Lcom/opongo/blogapp/manager/ImageManager$imgToLoad;
    }
.end annotation


# static fields
#the value of this static final field might be set in the static constructor
.field public static final DEBUG:Z = false

.field private static final TAG:Ljava/lang/String; = null

.field private static final THREAD_RETRY:I = 0x5


# instance fields
.field fileCache:Lcom/opongo/blogapp/utils/FileCache;

.field private imageViews:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Landroid/widget/ImageView;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

.field imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

.field private imgSize:I

.field memoryCache:Lcom/opongo/blogapp/utils/MemoryCache;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 35
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/manager/ImageManager;->DEBUG:Z

    .line 36
    const-class v0, Lcom/opongo/blogapp/manager/ImageManager;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/blogapp/manager/ImageManager;->TAG:Ljava/lang/String;

    .line 32
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 4
    .parameter "context"

    .prologue
    const/4 v1, 0x0

    const/4 v3, 0x1

    .line 48
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 38
    new-instance v0, Lcom/opongo/blogapp/utils/MemoryCache;

    invoke-direct {v0}, Lcom/opongo/blogapp/utils/MemoryCache;-><init>()V

    iput-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->memoryCache:Lcom/opongo/blogapp/utils/MemoryCache;

    .line 41
    new-instance v0, Ljava/util/WeakHashMap;

    invoke-direct {v0}, Ljava/util/WeakHashMap;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedMap(Ljava/util/Map;)Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imageViews:Ljava/util/Map;

    .line 45
    new-instance v0, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    invoke-direct {v0, p0, v1}, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;-><init>(Lcom/opongo/blogapp/manager/ImageManager;Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;)V

    iput-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    .line 46
    new-instance v0, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    invoke-direct {v0, p0, v1}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;-><init>(Lcom/opongo/blogapp/manager/ImageManager;Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;)V

    iput-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    .line 49
    iget-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->setPriority(I)V

    .line 50
    new-instance v0, Lcom/opongo/blogapp/utils/FileCache;

    invoke-direct {v0, p1}, Lcom/opongo/blogapp/utils/FileCache;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->fileCache:Lcom/opongo/blogapp/utils/FileCache;

    .line 55
    const/high16 v0, 0x4270

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 56
    invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v1

    .line 54
    invoke-static {v3, v0, v1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v0

    float-to-int v0, v0

    iput v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    .line 58
    sget-boolean v0, Lcom/opongo/blogapp/manager/ImageManager;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 59
    sget-object v0, Lcom/opongo/blogapp/manager/ImageManager;->TAG:Ljava/lang/String;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Calculated thumb img size is "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 60
    iget v2, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 59
    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 63
    :cond_0
    iget v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    rem-int/lit8 v0, v0, 0x2

    if-ne v0, v3, :cond_1

    .line 64
    iget v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    .line 66
    :cond_1
    return-void
.end method

.method static synthetic access$0(Lcom/opongo/blogapp/manager/ImageManager;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 127
    invoke-direct {p0, p1}, Lcom/opongo/blogapp/manager/ImageManager;->getBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$1(Lcom/opongo/blogapp/manager/ImageManager;)Ljava/util/Map;
    .locals 1
    .parameter

    .prologue
    .line 40
    iget-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imageViews:Ljava/util/Map;

    return-object v0
.end method

.method static synthetic access$2()Ljava/lang/String;
    .locals 1

    .prologue
    .line 36
    sget-object v0, Lcom/opongo/blogapp/manager/ImageManager;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method private decodeFile(Ljava/io/File;)Landroid/graphics/Bitmap;
    .locals 8
    .parameter "f"

    .prologue
    const/4 v5, 0x0

    .line 159
    :try_start_0
    new-instance v1, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v1}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 160
    .local v1, o:Landroid/graphics/BitmapFactory$Options;
    const/4 v6, 0x1

    iput-boolean v6, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 161
    new-instance v6, Ljava/io/FileInputStream;

    invoke-direct {v6, p1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/4 v7, 0x0

    invoke-static {v6, v7, v1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    .line 163
    iget v4, v1, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    .local v4, width_tmp:I
    iget v0, v1, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    .line 164
    .local v0, height_tmp:I
    const/4 v3, 0x1

    .line 166
    .local v3, scale:I
    :goto_0
    div-int/lit8 v6, v4, 0x2

    iget v7, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    if-lt v6, v7, :cond_0

    div-int/lit8 v6, v0, 0x2

    iget v7, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgSize:I

    if-ge v6, v7, :cond_1

    .line 174
    :cond_0
    new-instance v2, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v2}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 175
    .local v2, o2:Landroid/graphics/BitmapFactory$Options;
    iput v3, v2, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 176
    new-instance v6, Ljava/io/FileInputStream;

    invoke-direct {v6, p1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/4 v7, 0x0

    invoke-static {v6, v7, v2}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 179
    .end local v0           #height_tmp:I
    .end local v1           #o:Landroid/graphics/BitmapFactory$Options;
    .end local v2           #o2:Landroid/graphics/BitmapFactory$Options;
    .end local v3           #scale:I
    .end local v4           #width_tmp:I
    :goto_1
    return-object v5

    .line 168
    .restart local v0       #height_tmp:I
    .restart local v1       #o:Landroid/graphics/BitmapFactory$Options;
    .restart local v3       #scale:I
    .restart local v4       #width_tmp:I
    :cond_1
    div-int/lit8 v4, v4, 0x2

    .line 169
    div-int/lit8 v0, v0, 0x2
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 170
    mul-int/lit8 v3, v3, 0x2

    .line 165
    goto :goto_0

    .line 177
    .end local v0           #height_tmp:I
    .end local v1           #o:Landroid/graphics/BitmapFactory$Options;
    .end local v3           #scale:I
    .end local v4           #width_tmp:I
    :catch_0
    move-exception v6

    goto :goto_1
.end method

.method private getBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 9
    .parameter "url"

    .prologue
    .line 128
    iget-object v8, p0, Lcom/opongo/blogapp/manager/ImageManager;->fileCache:Lcom/opongo/blogapp/utils/FileCache;

    invoke-virtual {v8, p1}, Lcom/opongo/blogapp/utils/FileCache;->getFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v4

    .line 131
    .local v4, f:Ljava/io/File;
    invoke-direct {p0, v4}, Lcom/opongo/blogapp/manager/ImageManager;->decodeFile(Ljava/io/File;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 132
    .local v0, b:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_0

    .line 151
    .end local v0           #b:Landroid/graphics/Bitmap;
    :goto_0
    return-object v0

    .line 137
    .restart local v0       #b:Landroid/graphics/Bitmap;
    :cond_0
    const/4 v1, 0x0

    .line 138
    .local v1, bitmap:Landroid/graphics/Bitmap;
    :try_start_0
    new-instance v5, Ljava/net/URL;

    invoke-direct {v5, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    .line 140
    .local v5, imageUrl:Ljava/net/URL;
    invoke-virtual {v5}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v2

    .line 139
    check-cast v2, Ljava/net/HttpURLConnection;

    .line 141
    .local v2, conn:Ljava/net/HttpURLConnection;
    const/16 v8, 0x7530

    invoke-virtual {v2, v8}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    .line 142
    const/16 v8, 0x7530

    invoke-virtual {v2, v8}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    .line 143
    invoke-virtual {v2}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v6

    .line 144
    .local v6, is:Ljava/io/InputStream;
    new-instance v7, Ljava/io/FileOutputStream;

    invoke-direct {v7, v4}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 145
    .local v7, os:Ljava/io/OutputStream;
    invoke-static {v6, v7}, Lcom/opongo/blogapp/utils/StreamUtils;->CopyStream(Ljava/io/InputStream;Ljava/io/OutputStream;)V

    .line 146
    invoke-virtual {v7}, Ljava/io/OutputStream;->close()V

    .line 147
    invoke-direct {p0, v4}, Lcom/opongo/blogapp/manager/ImageManager;->decodeFile(Ljava/io/File;)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    move-object v0, v1

    .line 148
    goto :goto_0

    .line 149
    .end local v2           #conn:Ljava/net/HttpURLConnection;
    .end local v5           #imageUrl:Ljava/net/URL;
    .end local v6           #is:Ljava/io/InputStream;
    .end local v7           #os:Ljava/io/OutputStream;
    :catch_0
    move-exception v3

    .line 150
    .local v3, ex:Ljava/lang/Exception;
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    .line 151
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private queueImg(Ljava/lang/String;Landroid/app/Activity;Landroid/widget/ImageView;)V
    .locals 7
    .parameter "url"
    .parameter "activity"
    .parameter "imageView"

    .prologue
    .line 86
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    invoke-virtual {v4, p3}, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->clean(Landroid/widget/ImageView;)V

    .line 87
    new-instance v2, Lcom/opongo/blogapp/manager/ImageManager$imgToLoad;

    invoke-direct {v2, p0, p1, p3}, Lcom/opongo/blogapp/manager/ImageManager$imgToLoad;-><init>(Lcom/opongo/blogapp/manager/ImageManager;Ljava/lang/String;Landroid/widget/ImageView;)V

    .line 88
    .local v2, p:Lcom/opongo/blogapp/manager/ImageManager$imgToLoad;
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    #getter for: Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->imgsToLoad:Ljava/util/Stack;
    invoke-static {v4}, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->access$1(Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;)Ljava/util/Stack;

    move-result-object v5

    monitor-enter v5

    .line 89
    :try_start_0
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    #getter for: Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->imgsToLoad:Ljava/util/Stack;
    invoke-static {v4}, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->access$1(Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;)Ljava/util/Stack;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/util/Stack;->push(Ljava/lang/Object;)Ljava/lang/Object;

    .line 90
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgQueue:Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;

    #getter for: Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->imgsToLoad:Ljava/util/Stack;
    invoke-static {v4}, Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;->access$1(Lcom/opongo/blogapp/manager/ImageManager$PhotosQueue;)Ljava/util/Stack;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Object;->notifyAll()V

    .line 88
    monitor-exit v5
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 93
    const/4 v3, 0x0

    .line 94
    .local v3, state:Ljava/lang/Thread$State;
    const/4 v1, 0x1

    .line 97
    .local v1, i:I
    :goto_0
    const/4 v4, 0x5

    if-lt v1, v4, :cond_3

    .line 115
    sget-object v4, Ljava/lang/Thread$State;->NEW:Ljava/lang/Thread$State;

    if-ne v3, v4, :cond_0

    .line 116
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    invoke-virtual {v4}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->start()V

    .line 118
    :cond_0
    if-nez v3, :cond_2

    .line 119
    sget-boolean v4, Lcom/opongo/blogapp/manager/ImageManager;->DEBUG:Z

    if-eqz v4, :cond_1

    sget-object v4, Lcom/opongo/blogapp/manager/ImageManager;->TAG:Ljava/lang/String;

    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "Failed to get thread state "

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " times. Will spawn new thread..."

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 120
    :cond_1
    invoke-virtual {p0}, Lcom/opongo/blogapp/manager/ImageManager;->stopThread()V

    .line 121
    new-instance v4, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    const/4 v5, 0x0

    invoke-direct {v4, p0, v5}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;-><init>(Lcom/opongo/blogapp/manager/ImageManager;Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;)V

    iput-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    .line 122
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    const/4 v5, 0x4

    invoke-virtual {v4, v5}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->setPriority(I)V

    .line 123
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    invoke-virtual {v4}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->start()V

    .line 125
    :cond_2
    return-void

    .line 88
    .end local v1           #i:I
    .end local v3           #state:Ljava/lang/Thread$State;
    :catchall_0
    move-exception v4

    :try_start_1
    monitor-exit v5
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v4

    .line 99
    .restart local v1       #i:I
    .restart local v3       #state:Ljava/lang/Thread$State;
    :cond_3
    :try_start_2
    iget-object v4, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    invoke-virtual {v4}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->getState()Ljava/lang/Thread$State;
    :try_end_2
    .catch Ljava/lang/ArrayIndexOutOfBoundsException; {:try_start_2 .. :try_end_2} :catch_0

    move-result-object v3

    .line 100
    const/4 v1, 0x5

    goto :goto_0

    .line 101
    :catch_0
    move-exception v0

    .line 110
    .local v0, ex:Ljava/lang/ArrayIndexOutOfBoundsException;
    invoke-virtual {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;->printStackTrace()V

    .line 111
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method


# virtual methods
.method public clearCache()V
    .locals 2

    .prologue
    .line 267
    iget-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->memoryCache:Lcom/opongo/blogapp/utils/MemoryCache;

    invoke-virtual {v0}, Lcom/opongo/blogapp/utils/MemoryCache;->clear()V

    .line 268
    iget-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->fileCache:Lcom/opongo/blogapp/utils/FileCache;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/opongo/blogapp/utils/FileCache;->clear(I)I

    .line 269
    return-void
.end method

.method public displayImage(Ljava/lang/String;Landroid/app/Activity;Landroid/widget/ImageView;)V
    .locals 4
    .parameter "url"
    .parameter "activity"
    .parameter "imageView"

    .prologue
    .line 69
    if-eqz p3, :cond_0

    .line 70
    iget-object v1, p0, Lcom/opongo/blogapp/manager/ImageManager;->imageViews:Ljava/util/Map;

    invoke-interface {v1, p3, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 71
    :cond_0
    iget-object v1, p0, Lcom/opongo/blogapp/manager/ImageManager;->memoryCache:Lcom/opongo/blogapp/utils/MemoryCache;

    invoke-virtual {v1, p1}, Lcom/opongo/blogapp/utils/MemoryCache;->get(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 72
    .local v0, bitmap:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_3

    .line 73
    sget-boolean v1, Lcom/opongo/blogapp/manager/ImageManager;->DEBUG:Z

    if-eqz v1, :cond_1

    .line 74
    sget-object v1, Lcom/opongo/blogapp/manager/ImageManager;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Memory hit for "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 75
    :cond_1
    if-eqz p3, :cond_2

    .line 76
    invoke-virtual {p3, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 80
    :cond_2
    :goto_0
    return-void

    .line 78
    :cond_3
    invoke-direct {p0, p1, p2, p3}, Lcom/opongo/blogapp/manager/ImageManager;->queueImg(Ljava/lang/String;Landroid/app/Activity;Landroid/widget/ImageView;)V

    goto :goto_0
.end method

.method public stopThread()V
    .locals 1

    .prologue
    .line 194
    iget-object v0, p0, Lcom/opongo/blogapp/manager/ImageManager;->imgLoaderThread:Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;

    invoke-virtual {v0}, Lcom/opongo/blogapp/manager/ImageManager$ImageLoader;->interrupt()V

    .line 195
    return-void
.end method
